﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Net;
using System.Net.Sockets;
using System.Security.Cryptography;
using System.IO;
using System.Text.RegularExpressions;

namespace WebSocket
{
    class Program
    {
        static void Main(string[] args)
        {
            WebSocketClient client = new WebSocketClient("ws://127.0.0.1", 5678);

            client.OnOpen += delegate()
            {
                Console.WriteLine("Connected.");
            };

            client.OnMessage += delegate(object sender, byte[] data)
            {
                Console.WriteLine(Encoding.UTF8.GetString(data));
            };
        }
    }
}
